Ext.define('HuongNghiep.controller.HuongNghiep', {
    extend: 'Ext.app.Controller',

    stores: ['TaiKhoan'],

    models: ['TaiKhoan'],

		views: ['PanelImage',
						'TaiKhoanList'],

		/*
    init: function() {
        this.control({
            
						'viewport > userlist dataview': {
                itemdblclick: this.editUser
            },
            'useredit button[action=save]': {
                click: this.updateUser
            },
						'button[tenNut="themTaiKhoan"]':{
							click:function(nut){
								var la=Ext.create('HuongNghiep.view.TaoTaiKhoan');
								this.khungChinh=nut.up('viewport');
							}
						},
						'taoTaiKhoan button[id="them12"]':{
							click:function(nut){
								var khung2=nut.up('taoTaiKhoan');
								var khung =khung2.down('form');
								var ten1=khung.down('[name="tenTaiKhoan"]').getRawValue( );
								var ten2=khung.down('[name="matKhau"]').getRawValue( );
								var ten3=khung.down('[name="tenNguoiDung"]').getRawValue( );
								var ten4=khung.down('[name="email"]').getRawValue( );
								var dongMoi=Ext.create('HuongNghiep.model.TaiKhoan');
								dongMoi.set('tenTaiKhoan',ten1);
								dongMoi.set('matKhau',ten2);
								dongMoi.set('tenNguoiDung',ten3);
								dongMoi.set('email',ten4);
								var view1 = this.khungChinh;
								var bang1=view1.down('listTaiKhoan');
								var duLieu22=bang1.getStore();
								duLieu22.add(dongMoi);
								duLieu22.sync();
								console.log(view1);
							}
						},
						
        });
    },

    editUser: function(grid, record) {
        var edit = Ext.create('HuongNghiep.view.user.Edit').show();

        edit.down('form').loadRecord(record);
    },

    updateUser: function(button) {
        var win    = button.up('window'),
            form   = win.down('form'),
            record = form.getRecord(),
            values = form.getValues();

        record.set(values);
        win.close();
        this.getUsersStore().sync();
    }
		*/
});